package com.ckd.flyingtrip.fragment;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.fragment.app.Fragment;

import com.ckd.flyingtrip.R;
import com.ckd.flyingtrip.activity.MyVehicleActivity;
import com.ckd.flyingtrip.javabean.DingdanBean;
import com.ckd.flyingtrip.utils.Tools;

import java.util.List;

/*
* 电动车
* */
public class Fragment_MyVehicle extends Fragment {
    private MyVehicleActivity myVehicleActivity;
    private List<DingdanBean> list;
    private TextView txt_title,txt_paizi,txt_jieshao;
    private ImageView img_ddc;
    private View layoutView;
    private int posion;
    public Fragment_MyVehicle(MyVehicleActivity myVehicleActivity, List<DingdanBean> list, int posion){
        this.myVehicleActivity = myVehicleActivity;
        this.list = list;
        this.posion=posion;
    }
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        layoutView=inflater.inflate(R.layout.fragment_vehicle, container,false);
        init();
        DingdanBean dingdanBean = list.get(posion);
        txt_title.setText(dingdanBean.getBicycleName());
        txt_paizi.setText("地址:"+dingdanBean.getBicycleExtractAddress());
        Tools.loadImg(dingdanBean.getBicyclePictureUrl(),img_ddc);
        return layoutView;
    }

    private void init(){
        txt_title = layoutView.findViewById(R.id.txt_title);
        img_ddc = layoutView.findViewById(R.id.img_ddc);
        txt_paizi = layoutView.findViewById(R.id.txt_paizi);
        txt_jieshao = layoutView.findViewById(R.id.txt_jieshao);
    }



}
